package com.dao;

import org.hibernate.Session;

import entities.Product;
import com.util.*;
public class SaveProduct {
	public void saveProduct(Product p){
		Session session=null;
		try{
			session=HbnUtil.getSession();
			session.beginTransaction();
			session.save(p);
			session.beginTransaction().commit();
		}catch(Exception e){
			e.printStackTrace();
			session.beginTransaction().rollback();
		}finally{
			HbnUtil.releaseSession(session);
		}
	}
}
